package com.yzi.utilitys
{
	import flash.geom.Point;

	public class MathUtility
	{
		public function MathUtility()
		{
			throw new Error("Static Class");
		}
		
		static public function Quadrant($origin:Point, $target:Point): int
		{
			var result:int = 0;
			var calced:Point = $target.subtract($origin);
			
			if(calced.x > 0 && calced.y > 0) result = 1;
			else if(calced.x < 0 && calced.y > 0) result = 2;
			else if(calced.x < 0 && calced.y < 0) result = 3;
			else if(calced.x > 0 && calced.y < 0) result = 4;
			
			return result;
		}
		
		static public function ToAngle($radian:Number): Number
		{
			var angle:Number = $radian*180 / Math.PI;
			if(int(angle/360)!=0) angle = angle-360*int(angle/360);
			
			return angle;
		}
		
		static public function ToRadian($angle:Number): Number
		{
			var radian:Number = $angle * Math.PI/180;
			
			return radian;
		}
	}
}